const WX_PAY_URL = 'https://api.mch.weixin.qq.com'

const deepCopyJson = (obj) => {
  return JSON.parse(JSON.stringify(obj));
}

const randomString = (len, isString) => {
  let chars = isString ? 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz' : '01234567899876543210';
  let maxPos = len;
  let character = '';
  for (let i = 0; i < len; i++) {
      character += chars.charAt(Math.floor(Math.random() * maxPos))
  }
  console.log(character, 'character');
  return character;
}


module.exports = {
  deepCopyJson,
  WX_PAY_URL,
  randomString
}